﻿using System;
using System.Windows.Threading;
using Prism.Common.Interfaces;

namespace Prism.Services
{
  public class UIDispatcher : IDispatcherService
  {
    protected Dispatcher _dispatcher;

    public UIDispatcher(Dispatcher dispatcher)
    {
      _dispatcher = dispatcher;
    }

    public void Dispatch(Action action)
    {
      _dispatcher.BeginInvoke(action);
    }
  }
}
